<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
	xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
	xmlns:camunda="http://camunda.org/schema/1.0/bpmn" 
	targetNamespace="Examples">

	<process id="timerOnNestedSubprocesses" isExecutable="true">

		<startEvent id="theStart" />
		<sequenceFlow id="flow1" sourceRef="theStart" targetRef="subprocess" />

    <subProcess id="subprocess">
    
      <startEvent id="subprocessStart" />
      <sequenceFlow id="subFlow1" sourceRef="subprocessStart" targetRef="innerSubprocess" />
      
      <subProcess id="innerSubprocess">
        <startEvent id="innerSubprocessStart" />
        <sequenceFlow id="innerSubFlow1" sourceRef="innerSubprocessStart" targetRef="innerFork" />
        
        <parallelGateway id="innerFork" />
        <sequenceFlow id="innerSubFlow2" sourceRef="innerFork" targetRef="innerTask1" />
        <sequenceFlow id="innerSubFlow3" sourceRef="innerFork" targetRef="innerTask2" />
        
        <userTask id="innerTask1"  name="Inner subprocess task 1" />
        <userTask id="innerTask2"  name="Inner subprocess task 2" />
        
      </subProcess>
      
    </subProcess>
    <sequenceFlow id="flow3" sourceRef="subprocess" targetRef="theEnd" />

		<boundaryEvent id="boundaryTimer" cancelActivity="true" attachedToRef="subprocess">
			<timerEventDefinition>
			  <timeDuration>PT2H</timeDuration>
			</timerEventDefinition>
		</boundaryEvent>
		<sequenceFlow id="flow2" sourceRef="boundaryTimer" targetRef="taskAfterCatch" />
		<userTask id="taskAfterCatch" name="task outside subprocess" />
		
		<endEvent id="theEnd" />

	</process>

</definitions>